package com.cheer.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author cheer
 */
@Data
public class OaLearnAddDTO {

    @NotBlank(message = "标题不能为空")
    @Length(max = 50, message = "标题字符数不能大于50")
    private String name;

    @NotNull(message = "季不能为空")
    private Integer pid;

    @NotNull(message = "开始时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    @NotNull(message = "结束时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endTime;

    @NotBlank(message = "链接地址不能为空")
    private String url;

    @Length(max = 255, message = "本期描述字符数不能大于255")
    private String describe;

    @Length(max = 255, message = "缩略图地址字符数不能超过255")
    private String imgUrl;

    @Length(max = 255, message = "本期展示图地址字符数不能超过255")
    private String bqImgUrl;

    @ApiModelProperty("文章ID")
    private Integer articleId;

}
